package com.gvfish.backingbean;

import javax.faces.event.AbortProcessingException;
import javax.faces.event.ValueChangeEvent;
import javax.faces.event.ValueChangeListener;
import javax.persistence.EntityManagerFactory;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.gvfish.service.ArticleManager;

@Repository
public class Login {
	
	@Autowired
	private ArticleManager articleManager;
	
	
	private String userName;
	private String password;
	private ValueChangeListener change;
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	public String getResponse(){
		System.out.println("oK");
		return "yes";
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getUserName() {
		return userName;
	}
	public ValueChangeListener getChange() {
		System.out.println(articleManager.toString());
		return new ValueChangeListener() {
			@Override
			public void processValueChange(ValueChangeEvent arg0)
					throws AbortProcessingException {
				System.out.println(arg0.getSource().toString());
			}
		};
	}
}
